<template>
  <!--  有效贷款统计-->
<!--  <div style="padding: 0 10px">-->
<!--    <el-row :gutter="24">-->
<!--      <el-col class="label" v-for="item in column" :key="item.prop" :span="4">{{ item.label }}</el-col>-->
<!--    </el-row>-->
<!--    <el-row :gutter="24">-->
<!--      <el-col class="item" v-for="item in column" :key="item.prop" :span="4">{{ data[item.prop] }}</el-col>-->
<!--    </el-row>-->
<!--  </div>-->
  <Table :table-data="tableData" border
         :headerStyle="{backgroundColor:'#fffbed'}"
         :page="false"
         :tableColumn="tableColumn">
  </Table>
</template>

<script>
import {loanStatistics} from '@/api/order'
export default {
  props:['routesQuery'],
  data() {
    return {
      tableColumn: [
        {label: this.$t('贷款总金额'), align: 'center', prop: 'loanAmount'},
        {label: this.$t('贷款笔数'), align: 'center', prop: 'loanNumber'},
        {label: this.$t('结清笔数'), align: 'center', prop: 'settleNum'},
        {label: this.$t('最高贷款金额'), align: 'center', prop: 'maxLoanAmount'},
        {label: this.$t('曾逾期次数'), align: 'center', prop: 'overdueNumber'},
        {label: this.$t('曾逾期总本金'), align: 'center', prop: 'overduePrincipal'},
        {label: this.$t('正常还款率'), align: 'center', prop: 'normalRefundRate'},
      ],
      tableData:[],
      page: {
        pageNum: 1,
        pageSize: 10,
        total: 0
      }
    }
  },
  mounted() {
    this.getList()
  },
  methods: {
    async getList() {
      const {userId} = this.routesQuery
      const res = await loanStatistics({
        userId: parseInt(userId),
      })
      if (res.code === 1) {
        this.tableData = [res.data]
      }
    }
  }
}
</script>

<style scoped>
.label {
  border-bottom: 1px solid #dcdcdc;
  border-right: 1px solid #dcdcdc;
  text-align: center;
  height: 50px;
  line-height: 50px;
  background-color: #fffbed;
}

.item {
  border-bottom: 1px solid #dcdcdc;
  border-right: 1px solid #dcdcdc;
  text-align: center;
  height: 50px;
  line-height: 50px;
  color: #909399;
}
</style>
